package com.kangyi.user.controller;

import com.kangyi.dto.FeeQueryDTO;
import com.kangyi.result.Result;
import com.kangyi.user.service.FeeService;
import com.kangyi.vo.FeeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@RestController
@RequestMapping("user/fee")
@Slf4j
@Api(tags = "费用相关接口")
public class FeeController {

    @Autowired
    private FeeService nursingHomeFeeService;

    @GetMapping("/inquiry")
    @ApiOperation("查询养老院下的分类费用")
    public Result<List<FeeVO>> inquiryNursingHomeFee(FeeQueryDTO feeQueryDTO){
        log.info("查询此养老院下的费用:{}",feeQueryDTO);
        try {
            List<FeeVO> nursingHomeFeeVOList = nursingHomeFeeService.inquiryNursingHomeFee(feeQueryDTO);
            return Result.success(nursingHomeFeeVOList,"查询成功！");
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
    }

}
